package com.csht.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.csht.mapper.CshtGoodsImagesMapper;
import com.csht.model.CshtGoodsImages;
import com.csht.service.CshtGoodsImagesService;

/**
 * 商品图service
 * @author chenhuiyan
 *
 */
@Service
public class CshtGoodsImagesServiceImpl implements CshtGoodsImagesService {

	@Autowired
	private CshtGoodsImagesMapper cshtGoodsImagesMapper;
	
	/**
	 * 根据商品id查找对应的商品图片
	 */
	@Override
	public List<CshtGoodsImages> getGoodsImagesByGoodsId(Integer goodsId) throws Exception {
		List<CshtGoodsImages> cshtGoodsImagesList = cshtGoodsImagesMapper.getGoodsImagesByGoodsId(goodsId);
		return cshtGoodsImagesList;
	}

	/**
	 * 添加商品图 
	 */
	@Override
	public void insertGoodsImages(CshtGoodsImages cshtGoodsImages) throws Exception {
		cshtGoodsImagesMapper.insertGoodsImages(cshtGoodsImages);
	}

}
